import { ref, reactive, computed } from 'vue'
import axios from 'axios' //发送http请求

export default function () { //hooks封装数据和方法
    let sum = ref(0) //数据
    async function add() { //方法
        sum.value += 1
    }

    let bigSum = computed(() => { //计算属性
        return sum.value * 10
    })
    return { sum, add, bigSum } //返回
}